import Vue from 'vue'
import Router from 'vue-router'

import home from '@/views/home/home'
import menu from '@/views/menu/menu'
import goodsList from '@/views/goods/goods-list'
import goodsInfo from '@/views/goods/goods-info'
import goodsAdd from '@/views/goods/goods-add'
import classify from '@/views/config/classify'
import discuss from '@/views/discuss/discuss'
import login from '@/views/user/login'
import user from '@/views/user/user'

Vue.use(Router)

var routes = [{
  path: '/',
  name: 'menu',
  component: menu,
  children: [{
    path: '/home',
    name: 'home',
    component: home,
  }, {
    path: '/goods-list',
    name: 'goods-list',
    component: goodsList
  }, {
    path: '/goods-info',
    name: 'goods-info',
    component: goodsInfo
  }, {
    path: '/goods-add',
    name: 'goods-add',
    component: goodsAdd
  }, {
    path: '/classify',
    name: 'classify',
    component: classify
  }, {
    path: '/discuss',
    name: 'discuss',
    component: discuss
  }, {
    path: '/user',
    name: 'user',
    component: user
  }]
}, {
  path: '/login',
  name: 'login',
  component: login
}]

let router = new Router({
  routes
})


export default router